IOCTL
Section: System Calls (2)
Index
Return to Main Contents
BSD mandoc
BSD 4
NAME
ioctl
- control device
SYNOPSIS
Fd #include <sys/ioctl.h>
Ft int
Fn ioctl int d unsigned long request char *argp
DESCRIPTION
The
Fn ioctl
function manipulates the underlying device parameters of special files.
In particular, many operating
characteristics of character special files (e.g. terminals)
may be controlled with
Fn ioctl
requests.
The argument
Fa d
must be an open file descriptor.
An ioctl
Fa request
has encoded in it whether the argument is an
``in''
parameter
or
``out''
parameter, and the size of the argument
Fa argp
in bytes.
Macros and defines used in specifying an ioctl
Fa request
are located in the file
Ao Pa sys/ioctl.h Ac .
RETURN VALUES
If an error has occurred, a value of -1 is returned and
errno
is set to indicate the error.
ERRORS
Fn Ioctl
will fail if:
- Bq Er EBADF
-
Fa d
is not a valid descriptor.
- Bq Er ENOTTY
-
Fa d
is not associated with a character
special device.
- Bq Er ENOTTY
-
The specified request does not apply to the kind
of object that the descriptor
Fa d
references.
- Bq Er EINVAL
-
Fa Request
or
Fa argp
is not valid.
SEE ALSO
mt(1),
execve(2),
fcntl(2),
tty(4),
intro(4)
HISTORY
An
Fn ioctl
function call appeared in
AT&T System
v7 .
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUES
-
- ERRORS
-
- SEE ALSO
-
- HISTORY
-
This document was created by
man2html,
using the manual pages.
Time: 19:41:54 GMT, December 25, 2022